package com.aiyige.page.publish.info.model;

import android.graphics.Typeface;
import android.os.Parcel;
import android.os.Parcelable;

import com.aiyige.page.publish.info.adapter.PublishInfoAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.io.Serializable;

/**
 * Created by zhuyakun on 2017/11/10.
 */

public class PhotoNode implements MultiItemEntity{
    String photoUrl;
    boolean expand;
    String description;
    int nodeType = PublishInfoAdapter.NODE_TYPE_PHOTO;

    private PhotoNode(Builder builder) {
        setPhotoUrl(builder.photoUrl);
        setExpand(builder.expand);
        setDescription(builder.description);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public void setPhotoUrl(String photoUrl) {
        this.photoUrl = photoUrl;
    }

    public boolean isExpand() {
        return expand;
    }

    public void setExpand(boolean expand) {
        this.expand = expand;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getNodeType() {
        return nodeType;
    }

    public void setNodeType(int nodeType) {
        this.nodeType = nodeType;
    }

    @Override
    public int getItemType() {
        return nodeType;
    }


    public PhotoNode() {
    }


    public static final class Builder {
        private String photoUrl;
        private boolean expand;
        private String description;

        private Builder() {
            photoUrl = "";
            expand = false;
            description = "";
        }

        public Builder photoUrl(String photoUrl) {
            this.photoUrl = photoUrl;
            return this;
        }

        public Builder expand(boolean expand) {
            this.expand = expand;
            return this;
        }

        public Builder description(String description) {
            this.description = description;
            return this;
        }

        public PhotoNode build() {
            return new PhotoNode(this);
        }
    }
}
